﻿<UserControl x:Class="Mengsk.ProxyDelivery.App.UI.Order.OrderReturnBackUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
                xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             d:DesignHeight="300" d:DesignWidth="900" Loaded="UserControl_Loaded">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="开始时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Name="dpStart"  xctk:Format="Custom"  xctk:TimeFormatString="yyyy-MM-dd HH:mm:ss"  Margin="3" VerticalAlignment="Center" Width="150"/>
            <TextBlock Text="结束时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Name="dpEnd"  xctk:Format="Custom"  xctk:TimeFormatString="yyyy-MM-dd HH:mm:ss"  Margin="3" VerticalAlignment="Center" Width="150"/>
            <TextBlock Text="状态:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbStates" Margin="3" VerticalAlignment="Center" Width="100"/>
            <Button Name="btnQuery" Content="查询" Margin="3" VerticalAlignment="Center" Width="60" Click="btnQuery_Click"/>
        </StackPanel>

        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <TextBlock Text="退货编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbOrderChangeId" Margin="3" VerticalAlignment="Center" Width="150" PreviewKeyDown="tbOrderChangeId_PreviewKeyDown"/>
            <Button Name="btnClearAll" Content="清空所有" Margin="3" VerticalAlignment="Center" Width="80" Click="btnClearAll_Click"/>
            <Button Name="btnClearDown" Content="清空下面" Margin="3" VerticalAlignment="Center" Width="80" Click="btnClearDown_Click"/>
            <Button Name="btnMarkWaitToRefund" Content="退货成功" Margin="3" VerticalAlignment="Center" Width="80" Click="btnMarkWaitToRefund_Click"/>
            <Button Name="btnMarkFail" Content="退货失败" Margin="3" VerticalAlignment="Center" Width="80" Click="btnMarkFail_Click"/>
            <TextBlock Name="tbCount" Margin="3" VerticalAlignment="Center"/>
        </StackPanel>
        <DataGrid Grid.Row="2" Name="dgvAll" CanUserAddRows="False" GridLinesVisibility="All" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="退货编号" Binding="{Binding OrderChange.Id}" IsReadOnly="True"/>
                <DataGridTextColumn Header="卖家编号" Binding="{Binding OrderChange.SellerId}" IsReadOnly="True"/>
                <DataGridTextColumn Header="订单编号" Binding="{Binding OrderChange.OrderId}"  IsReadOnly="True"/>
                <DataGridTextColumn Header="商品信息" Binding="{Binding OrderChange.GoodsInfo}" IsReadOnly="True"/>
                <DataGridTextColumn Header="退货状态" Binding="{Binding OrderChange.State,Converter={StaticResource descriptionConverter}}" IsReadOnly="True"/>
                <DataGridTextColumn Header="处理状态" Binding="{Binding State}"  IsReadOnly="True"/>
                <DataGridHyperlinkColumn Header="删除" Width="Auto" Binding="{Binding Path=Action}" IsReadOnly="True">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Delete_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
                <DataGridTextColumn Header="描述" Binding="{Binding OrderChange.SystemComment}"/>
            </DataGrid.Columns>
        </DataGrid>
        <GridSplitter Grid.Row="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="3"/>
        <DataGrid Grid.Row="4" Name="dgvDown" CanUserAddRows="False" GridLinesVisibility="All" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="退货编号" Binding="{Binding OrderChange.Id}"  IsReadOnly="True"/>
                <DataGridTextColumn Header="卖家编号" Binding="{Binding OrderChange.SellerId}"  IsReadOnly="True"/>
                <DataGridTextColumn Header="订单编号" Binding="{Binding OrderChange.OrderId}"  IsReadOnly="True"/>
                <DataGridTextColumn Header="商品信息" Binding="{Binding OrderChange.GoodsInfo}"  IsReadOnly="True"/>
                <DataGridTextColumn Header="退货状态" Binding="{Binding OrderChange.State,Converter={StaticResource descriptionConverter}}"/>
                <DataGridTextColumn Header="处理状态" Binding="{Binding State}"  IsReadOnly="True"/>
                <DataGridHyperlinkColumn Header="删除" Width="Auto" Binding="{Binding Path=Action}" IsReadOnly="True">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Delete_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
                <DataGridTextColumn Header="描述" Binding="{Binding OrderChange.SystemComment}"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
